﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using ClassLibrary.Data;
using ClassLibrary.Entity;
using ClassLibrary.DAO;


public partial class Test : System.Web.UI.Page
{
    TblUserAccountDAO userDAO = new TblUserAccountDAO(Global.CONNECTION_STRING);
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btLogin_Click(object sender, EventArgs e)
    {
        TblUserAccount userAccount = new TblUserAccount();

        userAccount = userDAO.GetUser(txtUserName.Text, txtPass.Text);
        //Label1.Text = ;
        bool flag = false;
        try
        {
            if ((userAccount.Email == null) || (userAccount.Password == null))
                Label1.Text = "Login Fail";
            else
                flag = true;
        }
        catch (Exception ex)
        {
            //Session[Global.SESSION_ERROR] = ex;
            //Response.Redirect(Global.ERROR_PAGE);
            //throw e;
        }
        if (flag)
        {
            //Session[Global.SESSION_LOGGED_USER] = client;
            //Response.Redirect("~/BookingClientUser.aspx");
        }
    }
}
